unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, RzStatus, ExtCtrls, RzPanel;

type
  TForm1 = class(TForm)
    Btnx_1: TButton;
    RzStatusBar1: TRzStatusBar;
    RzProgressStatus1: TRzProgressStatus;
    RzStatusBar2: TRzStatusBar;
    RzProgressStatus2: TRzProgressStatus;
    procedure Btnx_1Click(Sender: TObject);
  private
    FStrsA:TStringList;
  public
  end;

  TDemo=class(TObject)
  public
    Code:string;
    Name:string;
  end;

var
  Form1: TForm1;

implementation

uses
  Class_KzUtils;

{$R *.dfm}

procedure TForm1.Btnx_1Click(Sender: TObject);
var
  DemoA:TDemo;
begin
  try

  FStrsA:=TStringList.Create;

  DemoA:=TDemo.Create;
  DemoA.Code:='x';
  DemoA.Name:='y';

  FStrsA.AddObject('',DemoA);

  DemoA:=TDemo.Create;
  DemoA.Code:='m';
  DemoA.Name:='n';

  FStrsA.AddObject('',DemoA);

  DemoA:=TDemo.Create;
  DemoA.Code:='a';
  DemoA.Name:='b';

  FStrsA.AddObject('',DemoA);
  Exit;


  //FreeAndNil(DemoA);
  //TKzUtils.TryFreeAndNil(FStrsA);

  //TKzUtils.JustCleanList(FStrsA);
  //FreeAndNil(fstrsa);


  finally
    TKzUtils.JustCleanList(FStrsA);
    FreeAndNil(fstrsa);  
  end;
end;

end.
